<!--
 * @Description  : 内容页 头部标题 
 * @Author       : zhao
 * @Date         : 2022-06-28 11:16:18
 * @LastEditors  : zhao
 * @LastEditTime : 2022-08-02 15:59:01
-->

<template>
  <div class="title" v-if="name">
    <div class="pwd_top">

      <SvgIcon v-if="back" :name="'ele-Back'" :size="30" @click="backs()" />
      <span>{{ name }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {
    name: String,
    icon: {
      type: String,
      default: 'el-icon-s-unfold'
    },
    back: Boolean
  },
  data() {
    return {}
  },

  computed: {},

  mounted() { },

  methods: {
    backs() {
      const router = this.$route.path
      let paths = router.split('/')
      paths.shift()
      paths.pop()
      let pa = ""
      paths.map(e => { pa += '/' + e })
      this.$router.push({ path: pa })
    }
  }
}
</script>
<style lang='scss' scoped>
.title {
  // padding-bottom: 10px;
}

.pwd_top {
  padding: 0 0px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: var(--el-color-primary-light-9) !important;
  border-radius: 5px 5px 0 0;

  span {
    text-decoration: none;
    color: var(--el-color-primary) !important;
    font-size: 20px;
    font-weight: 600;
    font-family: " 微软雅黑";
    padding: 10px;
  }

  i {
    padding-left: 10px;
    color: var(--el-color-primary) !important;
  }
}
</style>
